<?php
session_start();
//If your session isn't valid, it returns you to the login screen for protection
if(empty($_SESSION['myusername'])){
 header("location:main_login.php");
}
//echo $_SESSION['myusername'];

 //print_r($_POST);
 // connect to the database
 include('connect-db.php');
 
 // check if the form has been submitted. If it has, start to process the form and save it to the database
 if (isset($_POST['submit']))
 {
   $nature = mysql_real_escape_string(htmlspecialchars($_POST['nature']));
   if($nature == ''){
       header("Location: toolbox.php?error=21");
   }
   else{
   //add new case to the database
   //echo $typeofcase;
   
   mysql_query("INSERT natureofcase SET Ndescription='$nature'")
		or die(mysql_error()); 

	header("Location: toolbox.php?error=20");
	}
 }
 else header("Location: toolbox.php?error=11");
?>